package com.song.tools.mvc.mapper;

import cn.hutool.core.collection.CollUtil;

import java.util.List;

/**
 * 基础mapper
 *
 * @author song tools
 * @since 2024-07-10
 */
public interface BaseMapper<Entity> extends com.baomidou.mybatisplus.core.mapper.BaseMapper<Entity> {
    @SuppressWarnings("all")
    int insertBatchSomeColumn(List<Entity> entityList);

    @SuppressWarnings("all")
    default void insertBatchSomeColumn(List<Entity> entityList, int batchSize) {
        List<List<Entity>> splitArray = CollUtil.split(entityList, batchSize);
        splitArray.forEach(this::insertBatchSomeColumn);
    }
}
